

let db=require('../db/index')

exports.deleteArticleDataAPI=(req,res)=>{

    // --删除指定数据 
// DELETE FROM `student` WHERE id = 1
    var sql=`delete from article where id ='${req.query.id}' ` 
    // ,`update class set count=count-1 where class ='${req.query.class}'
    // var sql2=`update class set count=count-1 where class ='${req.query.class}' `
    db.query(sql,[
        req.query.user,
        req.query.title,
        req.query.id,
        req.query.content,
        req.query.date,
        req.query.class,
     
        
        
    ],(err,data)=>{
        if(err){
            return res.send('错误:'+err.message+'找不到该用户')
        }
        res.send(data)
    })
}